import { Entity, PrimaryGeneratedColumn, Column, OneToOne } from "typeorm";
import { IdCard } from "./IdCard";

@Entity({
  name: "user",
  database: "test",
  comment: "用户表",
})
export class User {
  @PrimaryGeneratedColumn({
    comment: "用户ID",
  })
  id: number;

  @Column()
  firstName: string;

  @Column()
  lastName: string;

  @Column()
  age: number;

  // // 一对一关系 一个用户对应一个身份证
  // @OneToOne(() => IdCard, (idCard) => idCard.user)
  // idCard: IdCard;
}
